package com.cj.controller;
import com.cj.po.Classes;
import com.cj.po.Dormgrade;
import com.cj.po.PageInfo;
import com.cj.po.Student;
import com.cj.service.DormgradeService;
import com.cj.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpRequest;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.List;

/**
 * 用户控制器类
 */
@Controller
public class DormgradeControoller {
    private final DormgradeService dormgradeService;

    public DormgradeControoller(DormgradeService dormgradeService) {
        this.dormgradeService = dormgradeService;
    }

    @RequestMapping(value = "/findDormitory")
    public String findDormitory(Integer d_id, Integer s_dormitoryid, String  d_dormbuilding,
                                   Integer  d_bedtotal,Integer  d_bed,String  a_name, Integer pageSize,Model model) {
        
        PageInfo<Dormgrade> pi =dormgradeService.findPageInfo( d_id,s_dormitoryid,d_dormbuilding,
                d_bedtotal,d_bed, a_name);


        model.addAttribute("pi",pi);
        model.addAttribute("d_id",d_id);
        return "dormitory_list";
    }
}
